package com.project.config;

import com.project.Main;
import com.project.service.IUserService;
import com.project.service.impl.UserServiceImpl;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

@Configuration//声明该类为配置类
//@ComponentScan("com.project") //扫描指定包，及其子包中的spring组件
@ComponentScan(basePackageClasses = Main.class)//扫描指定类所在的包，及子包中的spring组件
public class AppConfig {

//    @Bean("user")//"user"相当于id号
//    //@Scope("prototype")//多实例，默认情况是单例模式，加了这句话才能多实例
//    public IUserService getUser(){
//        return new UserServiceImpl();
//    }
}
